import Http from "@/a/utils/fetch.js";

//全局配置绑定
Object.assign(Http.prototype, {
	type: '',
	//微信授权登录
	async wxlogin(e) {
		//return 结构
		/*
		{
			code:200
			result token  Array
		}
		*/
		return this.post('/api/v1/family/familyWeChartMobileLogin', e).then(res => {
			if (res.code - 0 === 111005) {
				return res;
			}
			return {
				code: 200,
				result: Array.isArray(res) ? res : [res]
			};
		});
	},
	//账号绑定登录
	async login(e) {
		return this.post('/api/v1/family/familyAccountMobileLogin', e).then(res => {
			return {
				code: 200,
				result: Array.isArray(res) ? res : [res]
			};
		});
	},
	//获取当前用户信息
	async getInfo(e) {
		return this.get('/getLoginUserInfo');
	},
	//获取菜单
	async selectLoginUserMenu(e){
		return this.post('/api/v1/power/selectLoginUserMenu');
	}
});
